<!-- jQuery 3 -->
<script src="__STATIC__/lte/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="__STATIC__/lte/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="__STATIC__/lte/dist/js/adminlte.min.js"></script>
<!-- Layui App -->
<script src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['layer'], function(){
        var  $ = layui.jquery;
    });
    function member_out(){
        layer.confirm('确定要退出登录吗',function(){
            $.get("{:url('Login/loginOut')}", function (data){
                layer.msg('已退出登录!', {time:1000}, function(){
                    window.top.location.href="{:url('Login/index')}";
                });
            });
        })
    }
    function userInfo(){
        layer.open({
            type: 2,
            title:"个人信息",
            skin:'layui-layer-rim',
            area:['50%','70%'],
            content: "{:url('AdminUser/userInfo')}"
        });
    }
    function alterPwd(){
        layer.open({
            type: 2,
            title:"修改密码",
            btn: ['保存', '取消'],
            skin:'layui-layer-rim',
            area:['50%','70%'],
            content: "{:url('AdminUser/editPass')}",
            yes: function (index, layero) {
                var iframeWin  = window[layero.find('iframe')[0]['name']];
                var attr_data = iframeWin.confirm();
                $.post("{:url('AdminUser/savePass')}", attr_data,function(res){
                    if (res.status==1){
                        layer.msg(res.msg,{time:2000},function(index, layero){
                            location.href=res.url;
                        });
                        return false;
                    }else{
                        layer.msg(res.msg,{time:2000});
                        return false;
                    }
                }, "json");
            }
        });
    }
</script>